// latitude:40.10038,//纬度
// longitude:116.36867,//经度
// address:{},//地址信息对象
// categorys:[],//分类数组
// shops:[],//商家数组

// export const RECEIVE_ADDRESS='receive_address'
// //接收分类数组
// export const RECEIVE_CATEGORYS='receive_categorys'
// //接收商家数组
// export const RECEIVE_SHOPS='receive_shops'
//解构楚mutations-type.js里创建的常量并引入
import {RECEIVE_ADDRESS,RECEIVE_CATEGORYS,RECEIVE_SHOPS,USER_INFO,LOGIN_OUT,SHOP_GOODS,SHOP_INFO,SHOP_RATINGS} from './mutations-type'
 //SHOP_GOODS   SHOP_INFO   SHOP_RATINGS
export default{

// 由于声明了RECEIVE_SHOPS='receive_shops'/这时就等于字符串用[]括起来  规范写法没别的意思
  [RECEIVE_CATEGORYS](state,categorys){
    state.categorys=categorys;
  },
  [RECEIVE_SHOPS](state,shops){
    state.shops=shops;
  },
  [USER_INFO](state,data){
    console.log(data)
   state.userInfo=data;
  },
  [LOGIN_OUT](state){
    state.userInfo={};
  },
//更新商品信息
  [SHOP_GOODS](state,{goods}){
    state.goods=goods
    console.log(state.goods)
  },
//更新商家信息
[SHOP_INFO](state,shopInfo){

  state.info=shopInfo
},

//更新评论信息
[SHOP_RATINGS](state,{shopRatings}){
  state.ratings=shopRatings
},

}



//getShopGoods  getShopInfo getShopRatings
  //SHOP_GOODS   SHOP_INFO   SHOP_RATINGS
